package com.gitee.smsdistribution.repository;

import com.gitee.smsdistribution.model.DistributionPolicy;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

@Repository
public interface DistributionPolicyRepository extends JpaRepository<DistributionPolicy, Long>, JpaSpecificationExecutor<DistributionPolicy> {
    // 分页查询方法，根据keyword模糊查询所有字段
    Page<DistributionPolicy> findAllBy(
            String name,
            String baseUrl,
            String strategy,
            Pageable pageable);

    DistributionPolicy findByName(String name);
}
